package com.agilestudio.ifinance.service.account;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.agilestudio.ifinance.dao.account.ContactDao;
import com.agilestudio.ifinance.entity.account.Contact;


@Component
@Transactional
public class ContactService {

	private ContactDao contactDao;
	
	public void addContact(Contact contact) {
		contactDao.save(contact);
	}

	public List<Contact> listContact() {

		return contactDao.getAll();
	}

	public void removeContact(Long id) {
		contactDao.delete(id);
	}
	
	@Autowired
	public void setContactDao(ContactDao contactDao) {
		this.contactDao = contactDao;
	}	
}
